import json

import pytest
import requests

from basic基础层.make_data造数据 import MakeFakerData
from const路径管理 import TOKEN_PATH
from step层比接口层还抽象.step_marketing import Step as MarketingStep

mark = MarketingStep()
faker=MakeFakerData()


# @pytest.fixture(scope="session", autouse=True)
def login():
    data = {
        "url": 'http://124.70.39.201/adminapi/login',
        "params": {
            'username': 'admin',
            'password': '123123',
        }

    }
    token = {"token": requests.get(**data).json()['data']['token']}
    with open(str(TOKEN_PATH), 'w') as f:
        json.dump(token, f)


login()


def init_db():
    # 初始化数据
    pass
